unit stack;

interface
uses stlmain, stl_types, vector, stl_base;
type S_Iterator = stl_base.iterator;
Type TStack = class(Tvector)
private
  _IBEGIN, _IEND: S_Iterator;
  public
    procedure push_back(const el:STLTYPE);
    procedure pop_back;
    function top:StlType;
end;
implementation

procedure Tstack.push_back(const el:STLTYPE);
var
  elem: Iterator;
begin
  New(Elem);
  Elem^.data :=  el;
  Elem^.prev := _IEND;
  Elem^.next := nil;
//  push_back :=
end;

procedure Tstack.pop_back;
var
  pnt:Iterator;
begin
  if (_IEND <> nil) then
  begin
    pnt := _IEND;
    Dispose(pnt);
    _IEND := _IEND^.prev;
  end;
end;

function Tstack.top:StlType;
begin
  if (_IEND <> nil) then
    top := _IEND^.data;
end;

end.
